<%@ page language="java" import="java.util.*,org.bluebee.billiardsbar.dao.*,org.bluebee.billiardsbar.dao.impl.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="../SOURCE/images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 包间列表</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1">
              <input type="checkbox" name="checkbox11" id="checkbox11" />
              全选      &nbsp;&nbsp;<img src="../SOURCE/images/add.gif" width="10" height="10" /> 添加   &nbsp; <img src="../SOURCE/images/del.gif" width="10" height="10" /> 删除    &nbsp;&nbsp;<img src="../SOURCE/images/edit.gif" width="10" height="10" /> 编辑   &nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
      <tr>
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE10"><div align="center">
        </div></td>
        <td width="25%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">包间号</span></div></td>
        <td width="30%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">包间名</span></div></td>
        <td width="25%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">球桌数</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      </tr>
      <%
		IRoomDao roomdao=new RoomDaoImpl();
		ArrayList<HashMap<String,Object>> list=roomdao.getRoomList((String)request.getParameter("page"),20);
		String totalTopic="0";
		String currentpage="0";
		String totalpage="0";
		String url="";
		if(list!=null){
			HashMap<String,Object> mappage = (HashMap<String,Object>)list.get(list.size()-1);
     		if(mappage.get("totaltopic")!=null){totalTopic=mappage.get("totaltopic").toString();}
     		if(mappage.get("totaltopic")!=null){currentpage=mappage.get("currentpage").toString();}
     		if(mappage.get("totalpage")!=null){totalpage=mappage.get("totalpage").toString();}
     		if(mappage.get("url")!=null){url=mappage.get("url").toString();}
		for ( int i = 0; i < list.size()-1; i++ ) { 
			HashMap<String,Object> map = (HashMap<String,Object>)list.get(i);
			if(map!=null){
	%>
	<tr>
      	<td height="20" bgcolor="#FFFFFF"><div align="center">
      		<input type="checkbox" name="<%if(map.get("ROOMID")!=null) out.print(map.get("ROOMID").toString());%>" id="<%if(map.get("ROOMID")!=null)out.print(map.get("ROOMID").toString());%>" />
      		</div></td>
      	<td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19"><%if(map.get("ROOMID")!=null)out.print(map.get("ROOMID").toString());%></span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if(map.get("ROOMNAME")!=null)out.print(map.get("ROOMNAME").toString());%></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if(map.get("TABLENUMBER")!=null)out.print(map.get("TABLENUMBER").toString());%></div></td> 
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21">删除 | 查看</div></td>
      </tr>
     <%	}
     	
       }
     }%>

    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
       
        <td width="33%"><div align="left"><span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong><%=totalTopic%></strong> 条记录，当前第<strong><%=currentpage%></strong> 页，共 <strong><%=totalpage%></strong> 页</span></div></td>
        
        <td width="67%">
        <form action="">
        <table width="312" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
          
            <td width="49"><div align="center"><a href="<%=url%>?page=1"><img src="../SOURCE/images/main_54.gif" width="40" height="15" /></a></div></td>
            <td width="49"><div align="center"><a href="<%=url%>?page=<%=(Integer.valueOf(currentpage)-1) %>"><img src="../SOURCE/images/main_56.gif" width="45" height="15" /></a></div></td>
            <td width="49"><div align="center"><a href="<%=url%>?page=<%=(Integer.valueOf(currentpage)+1) %>"><img src="../SOURCE/images/main_58.gif" width="45" height="15" /></a></div></td>
            <td width="49"><div align="center"><a href="<%=url%>?page=<%=totalpage%>"><img src="../SOURCE/images/main_60.gif" width="40" height="15" /></a></div></td>
            <td width="37" class="STYLE22"><div align="center">转到</div></td>
            
            <td width="22"><div align="center">
              <input type="text" name="pagenum" id="pagenum"  style="width:20px; height:12px; font-size:12px; border:solid 1px #7aaebd;"/>
            </div></td>
            <td width="22" class="STYLE22"><div align="center">页</div></td>
            
            <td width="35"><a href="<%=url%>?page=${requestScope.param.pagenum}"><img src="../SOURCE/images/main_62.gif" width="26" height="15" /></a></td>
         
          </tr>
      
        </table>
        </form>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

